package com;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

/**
 *动态解析SQL
 * @author zhongxu
 */
@SpringBootApplication
@MapperScan("com.tom.mapper")
@Slf4j
public class DynamicAnalysisSqlApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(DynamicAnalysisSqlApplication.class, args);
        ConfigurableEnvironment environment = context.getEnvironment();
        String port = environment.getProperty("server.port");
        String serverName = environment.getProperty("spring.application.name");
        log.info("{}服务启动成功!!!,swagger访问地址:http://localhost:{}/doc.html",serverName,port);
    }
}